package com.power.using.mytoutiao.manager;

import android.app.Application;
import android.content.Context;

import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;

/**
 * Created by 聪明一只哈 on 2020/4/2.
 * Time: 2020/4/2  11:04
 */
public class SdkManager {

    public static void initStetho(Context context){
        Stetho.initializeWithDefaults(context);
    }


    public static OkHttpClient.Builder initInterceptor(OkHttpClient.Builder builder){
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        builder.addInterceptor(interceptor);

        return builder;
    }


    public static void initLeakCanary(Application app){
        if(LeakCanary.isInAnalyzerProcess(app)){
            return;
        }
        LeakCanary.install(app);

    }
}
